<?php


namespace app\worker\controller;


use think\Log;
use think\worker\Server;
use think\facade\Db;

class Worker extends Server
{
    protected $socket = 'websocket://0.0.0.0:2345';
    public function onWorkerStart($worker)
    {
        $time_interval = 2;

        $shop_id = 1;
        \Workerman\Lib\Timer::add($time_interval, function () use ($shop_id) {

          /* echo "<pre>";
            echo "你是谁".$shop_id."我来也";
            echo "<pre>";*/

        });


    }
    public function onMessage($connection,$data)
    {
        \think\facade\Log::record($data);
        \think\facade\Log::record(111111);
        $connection->send($data);
    }
}